package com.example.demo.controller;

import com.example.demo.component.UserComponent;
import com.example.demo.configuration.UserConfig;
import com.example.demo.model.UserInfo;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {
    @Autowired
    private UserService userService;

    public void sayHi(){
        System.out.println("controller:sayHi");
        userService.sayHi();
    }

//    public UserController() {
//    }
//
    @Autowired
    public UserController(UserService userService) {
        this.userService = userService;
    }


//    @Autowired
//    public void setUserService(UserService userService) {
//        this.userService = userService;
//    }
}
